<at-panel ng-if="!$state.current.name.includes('permissions')">
    <at-panel-heading>{{ vm.panelTitle }}</at-panel-heading>

    <at-tab-group>
        <at-tab state="vm.tab.details">{{:: vm.strings.get('tab.DETAILS') }}</at-tab>
        <at-tab state="vm.tab.permissions">{{:: vm.strings.get('tab.PERMISSIONS') }}</at-tab>
    </at-tab-group>

    <at-panel-body>
        <at-form state="vm.form" autocomplete="off">
            <at-input-text col="4" tab="1" state="vm.form.name"></at-input-text>
            <at-input-text col="4" tab="2" state="vm.form.description"></at-input-text>
            <at-input-lookup col="4" tab="3" state="vm.form.organization"></at-input-lookup>

            <at-divider></at-divider>

            <at-input-lookup col="4" tab="5" state="vm.form.credential_type"></at-input-lookup>

            <at-input-group col="4" tab="6" state="vm.form.inputs">
                {{:: vm.strings.get('inputs.GROUP_TITLE') }}
            </at-input-group>

            <at-action-group col="12" pos="right">
                <at-form-action type="cancel" to="credentials"></at-form-action>
                <at-form-action type="save"></at-form-action>
            </at-action-group>
        </at-form>
    </at-panel-body>
</at-panel>

<at-panel ng-if="$state.current.name.includes('permissions')" on-dismiss="credentials">
    <at-panel-heading>{{:: vm.strings.get('permissions.TITLE') }}</at-panel-heading>

    <at-tab-group>
        <at-tab state="vm.tab.details">{{:: vm.strings.get('tab.DETAILS') }}</at-tab>
        <at-tab state="vm.tab.permissions">{{:: vm.strings.get('tab.PERMISSIONS') }}</at-tab>
    </at-tab-group>

    <at-panel-body>
        <div class="at-CredentialsPermissions" ui-view="related"></div>
    </at-panel-body>
</at-panel>

<div ng-if="$state.current.name.includes('permissions.add')" ui-view="modal"></div>

